.code

EXTERN SW2_GetSyscallNumber: PROC

NtAllocateVirtualMemory PROC
	mov [rsp +8], rcx          ; Save registers.
	mov [rsp+16], rdx
	nop
	inc rdx
	nop
	dec rdx
	mov [rsp+24], r8
	nop
	mov [rsp+32], r9
	sub rsp, 28h
	mov ecx, 00D9F0913h
	nop
	nop							; Load function hash into ECX.
	call SW2_GetSyscallNumber  ; Resolve function hash into syscall number.
	add rsp, 28h
	mov rcx, [rsp +8]          ; Restore registers.
	nop
	nop
	mov rdx, [rsp+16]
	mov r8, [rsp+24]
	nop
	mov r9, [rsp+32]
	mov r10, rcx
	inc rax
	dec rax
	syscall                    ; Invoke system call.
	ret
NtAllocateVirtualMemory ENDP

NtWriteVirtualMemory PROC

	nop
	nop
	mov [rsp +8], rcx          ; Save registers.
	mov [rsp+16], rdx
	mov [rsp+24], r8
	inc rax
	dec rax
	mov [rsp+32], r9
	sub rsp, 28h
	mov ecx, 012991C10h        ; Load function hash into ECX.
	call SW2_GetSyscallNumber  ; Resolve function hash into syscall number.
	add rsp, 28h
	mov rcx, [rsp +8]          ; Restore registers.
	mov rdx, [rsp+16]
	nop
	nop
	mov r8, [rsp+24]
	mov r9, [rsp+32]
	inc rcx
	dec rcx
	nop
	mov r10, rcx
	syscall                    ; Invoke system call.
	ret
NtWriteVirtualMemory ENDP

NtProtectVirtualMemory PROC
	mov [rsp +8], rcx          ; Save registers.
	mov [rsp+16], rdx
	nop
	inc rax
	inc rax
	mov [rsp+24], r8
	nop
	dec rax
	nop
	dec rax
	mov [rsp+32], r9
	sub rsp, 28h
	mov ecx, 0C840D8DAh        ; Load function hash into ECX.
	call SW2_GetSyscallNumber  ; Resolve function hash into syscall number.
	add rsp, 28h
	mov rcx, [rsp +8] 
	nop
	inc cx
	dec cx
	nop
	mov rdx, [rsp+16]
	mov r8, [rsp+24]
	mov r9, [rsp+32]
	mov r10, rcx
	inc rbx
	dec rbx
	syscall                    ; Invoke system call.
	ret
NtProtectVirtualMemory ENDP

NtQueueApcThread PROC
	mov [rsp +8], rcx          ; Save registers.
	mov [rsp+16], rdx
	mov [rsp+24], r8
	mov [rsp+32], r9
	sub rsp, 28h
	inc rbx
	dec rbx
	mov ecx, 012881E1Bh        ; Load function hash into ECX.
	call SW2_GetSyscallNumber  ; Resolve function hash into syscall number.
	add rsp, 28h
	nop
	inc cx
	dec cx
	nop
	mov rcx, [rsp +8]          ; Restore registers.
	mov rdx, [rsp+16]
	inc rax
	nop
	inc rax
	dec rax
	nop
	dec rax
	mov r8, [rsp+24]
	mov r9, [rsp+32]
	mov r10, rcx
	nop
	nop
	syscall                    ; Invoke system call.
	ret
NtQueueApcThread ENDP

end